﻿<%@ Page Language="VB" MasterPageFile="~/masterpages/Main.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="events_admin_Default" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="fullContent">
        <h2>Events</h2>
        
        <a href="addEvent.aspx?Action=Add">Add Event</a>
        <asp:ObjectDataSource ID="dsEvents" runat="server" DeleteMethod="Delete" 
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetEvents" TypeName="MainDbTableAdapters.EventsTableAdapter" 
            UpdateMethod="Update">
            <DeleteParameters>
                <asp:Parameter Name="Original_EventID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="UserID" Type="Int32" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Desc" Type="String" />
                <asp:Parameter Name="Date" Type="DateTime" />
                <asp:Parameter Name="Location" Type="String" />
                <asp:Parameter Name="Private" Type="Boolean" />
                <asp:Parameter Name="Original_EventID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="UserID" Type="Int32" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Desc" Type="String" />
                <asp:Parameter Name="Date" Type="DateTime" />
                <asp:Parameter Name="Location" Type="String" />
                <asp:Parameter Name="Private" Type="Boolean" />
            </InsertParameters>
        </asp:ObjectDataSource>
        
        <asp:GridView ID="gridEvents" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="EventID" DataSourceID="dsEvents" ForeColor="#333333" 
            GridLines="None" Width="787px">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="EventID" InsertVisible="False" ReadOnly="True" 
                    SortExpression="EventID">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:BoundField DataField="UserID" SortExpression="UserID">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:BoundField DataField="Desc" HeaderText="Desc" SortExpression="Desc">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" 
                    DataFormatString="{0:f}">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:BoundField DataField="Location" HeaderText="Location" 
                    SortExpression="Location">
                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </asp:BoundField>
                <asp:CheckBoxField DataField="Private" HeaderText="Private" 
                    SortExpression="Private" />
                <asp:CommandField ShowDeleteButton="True" ShowSelectButton="True" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>


    </div>
</asp:Content>

